#!/usr/bin/perl -w
#   Written by Jimmy Saw - 10-11-2007
#   This program takes a Genbank file and extract coordinates of genes 
#   You have to redirect output to a file

use Bio::SeqIO;

my $seqio_obj = Bio::SeqIO->new (-file => $ARGV[0], -format => 'genbank');
my $seq_obj = $seqio_obj->next_seq;

for my $feat_obj ($seq_obj->get_SeqFeatures){
    if ($feat_obj->primary_tag eq "CDS"){

    for my $value ($feat_obj->get_tag_values('product')){
        my $start = $feat_obj->start;
        my $end = $feat_obj->end;
        print $start, "\t", $end, "\t", $value,"\n";
        }
    }
}
